#pragma once
#include "types.h"

nInt getBMPSize(nInt width, nInt height, nInt bit);
void yuv422p_levels_extend(byte* dst, byte* src, nInt width, nInt height, byte step, byte* outLuminanceMin, byte* outLuminanceMax);
nBool yuv422p_check_grid33(byte* src, byte lightValue);
byte yuv422p_avgerage_grid33(byte* src);
nInt yuv422p_sum_grid33(byte* src);
nInt yuv422p_threshold(byte* dst, byte* src, nInt width, nInt height, byte value);
void yuv422p_threshold_iteration(byte* dst, byte* src, nInt width, nInt height, nInt k);
void yuv422_adaptive_threshold(byte* dst, byte* src, nInt w, nInt h, nDouble k, nInt windowSize);
void yuv422p_perform_gaussian_filter(byte* dst, byte* src, nInt width, nInt height, nDouble sigma);
void yuv422p_perform_median_filter(byte* dst, byte* src, nInt width, nInt height);
void yuv422p_convert_to(byte* dst, byte* src, nInt width, nInt height, nDouble alpha, nDouble beta);
void yuv422p_levels(byte* dst, byte* src, nInt width, nInt height, byte minV, byte maxV, byte step, byte useAll);
void yuv422p_gray(byte* dst, byte* src, nInt width, nInt height);
void yuv422p_to_yuvI420(byte* dst, byte* src, nInt width, nInt height);
void convert_yuv422p_rgb24(byte* dst, byte* src, nInt width, nInt height);
void convert_rgb24_yuv422p(byte* dst, byte* src, nInt width, nInt height);
void yuv422p_zoom_out(byte* dst, byte* src, nInt width, nInt height, nInt dstWidth, nInt dstHeight);
void yuv422p_simplify_color_64(byte* dst, byte* src, nInt width, nInt height);
void yuv422p_to_histogram(byte* dst, byte* src, nInt width, nInt height);
byte yuv422p_avgerage(byte* src, nInt width, nInt height);
void yuv422p_copy_uv(byte* dst, byte* src, nInt width, nInt height, nBool useGray);